//
//  BalanceViewController.m
//  HTHappySale
//
//  Created by 创维海通 on 2017/9/27.
//  Copyright © 2017年 zxyywy. All rights reserved.
//

#import "BalanceViewController.h"

//Request
#import "HTTPPromise+Me.h"

//Tools
#import "UIImageView+WebCache.h"
#import "AppUtil.h"

@interface BalanceViewController ()
@property (strong, nonatomic) IBOutlet UIImageView *explanImg;

@end

@implementation BalanceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self addNavigationLeftView:@"" andType:0];
    [self addNavigationMiddleView:@"提现说明"];
    
    [self initRequest];
}

- (void)initRequest
{
    __weak __typeof(self)weakSelf = self;
    [HTTPPromise requestWithdrawDescriptionParams:nil Success:^(id responseObj) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        NSLog(@"%@",responseObj);
        int successRet =[responseObj[@"ret"] intValue];
        
        if (successRet == 0) {
            NSString *ImgStr = [NSString stringWithFormat:@"%@%@",Img_URL,responseObj[@"image"]];
            [strongSelf.explanImg sd_setImageWithURL:[NSURL URLWithString:ImgStr] placeholderImage:HTCFQuickImage(@"Headportrait")];
        }else{
            [AppUtil showTipMessage:responseObj[@"desc"]];
        }
    } failure:^(NSError *error) {
        NSLog(@"%@",error.userInfo);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
